﻿using FluentAssertions;
using LINQPad.OpenAccess.Configuration.Modules;
using LINQPad.OpenAccess.Metadata;
using LINQPad.OpenAccess.Metadata.Reflection.Locators;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Ninject;

namespace LINQPad.OpenAccess.Tests.Metadata
{
    [TestClass]
    public class AssemblyParserFixture
    {
        [TestMethod]
        public void DefaultInstanceContainsTheDefaultLocators( )
        {
            using ( var kernel = new StandardKernel( new LINQPadOpenAccessModule( ) ) )
            {
                var parser = kernel.Get<AssemblyParser>( );

                parser.ContextTypeLocators
                      .Should( )
                      .Contain( i => i is ContextTypeLocator );

                parser.MetadataSourceLocators
                      .Should( )
                      .Contain( i => i is XmlMetadataSourceLocator )
                      .And.Contain( i => i is FluentMetadataSourceLocator )
                      .And.Contain( i => i is AttributesMetadataSourceLocator );
            }
        }
    }
}